﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Proyecto_XNA
{
    class Sprite
    {
        #region Properties

        private Texture2D m_kTexture;
        public Texture2D Texture
        { 
            get { return m_kTexture; }
            set { m_kTexture = value; }
        }

        private Vector2 m_vPosition;
        public Vector2 Position
        {
            get { return m_vPosition; }
            set { m_vPosition = value; }
        }
        
        public float PositionX
        {
            get { return m_vPosition.X; }
            set { m_vPosition.X = value; }
        }

        public float PositionY
        {
            get { return m_vPosition.Y; }
            set { m_vPosition.Y = value; }
        }

        private Rectangle m_kCurrentPlayableRect;
        public Rectangle CurrentPlayableRect
        {
            get { return m_kCurrentPlayableRect; }
            set { m_kCurrentPlayableRect = value; }
        }

        private float m_fpAngle;
        public float Angle
        {
            get { return m_fpAngle; }
            set { m_fpAngle = value; }
        }

        #endregion

        public Sprite(Texture2D kTexture, Vector2 vPosition)      
        {
            this.m_kTexture = kTexture;
            this.m_vPosition = vPosition;
        }

        public void DrawSprite(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(m_kTexture, m_vPosition, Color.White);
        }

        public Rectangle GetPlayableRectangle()
        {
            return m_kCurrentPlayableRect;
        }

        public void SetTexture(Texture2D kTexture)
        {
            m_kTexture = kTexture;
        }
    }
}
